using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeoAnalyticsServerTools._FindLocations
{
    /// <summary>
    /// <para>Find Dwell Locations</para>
    /// <para>Finds locations where moving objects have stopped, or dwelled, using given time and distance thresholds.</para>
    /// <para>使用给定的时间和距离阈值查找移动对象停止或停留的位置。</para>
    /// </summary>    
    [DisplayName("Find Dwell Locations")]
    public class FindDwellLocations : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FindDwellLocations()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_features">
        /// <para>Input Features</para>
        /// <para>The point tracks from which to find dwells. The input must be a time-enabled layer with features that represent instants in time.</para>
        /// <para>从中查找居住点的轨迹。输入必须是启用时间的图层，其要素可以表示时间中的瞬间。</para>
        /// </param>
        /// <param name="_output_name">
        /// <para>Output Dataset</para>
        /// <para>The name of the output feature service.</para>
        /// <para>输出要素服务的名称。</para>
        /// </param>
        /// <param name="_track_fields">
        /// <para>Track Fields</para>
        /// <para>One or more fields that will be used to identify unique tracks.</para>
        /// <para>将用于标识唯一轨迹的一个或多个字段。</para>
        /// </param>
        /// <param name="_distance_method">
        /// <para>Distance Method</para>
        /// <para><xdoc>
        ///   <para>Specifies how the distances between dwell features will be calculated.</para>
        ///   <bulletList>
        ///     <bullet_item>Geodesic— If the spatial reference can be panned, tracks will cross the international date line when appropriate. If the spatial reference cannot be panned, tracks will be limited to the coordinate system extent and may not wrap.</bullet_item><para/>
        ///     <bullet_item>Planar—Planar distances will be used.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何计算驻留要素之间的距离。</para>
        ///   <bulletList>
        ///     <bullet_item>测地线 - 如果可以平移空间参考，则轨迹将在适当时穿过国际日期变更线。如果无法平移空间参考，则轨迹将被限制在坐标系范围内，并且可能无法换行。</bullet_item><para/>
        ///     <bullet_item>Planar—将使用平面距离。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_distance_tolerance">
        /// <para>Distance Tolerance</para>
        /// <para>The maximum distance between points to be considered a single dwell location.</para>
        /// <para>要被视为单个驻留位置的点之间的最大距离。</para>
        /// <para>单位： Feet | Yards | Miles | NauticalMiles | Meters | Kilometers </para>
        /// </param>
        /// <param name="_time_tolerance">
        /// <para>Time Tolerance</para>
        /// <para><xdoc>
        ///   <para>The minimum time duration to be considered a single dwell location.</para>
        ///   <para>Both time and distance are considered when finding dwells. The Distance Tolerance parameter specifies distance.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>被视为单个停留位置的最短持续时间。</para>
        ///   <para>在寻找驻留时，要考虑时间和距离。Distance Tolerance 参数指定距离。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_output_type">
        /// <para>Output Type</para>
        /// <para><xdoc>
        ///   <para>Specifies how the dwell features will be output.</para>
        ///   <bulletList>
        ///     <bullet_item>Dwell features— All of the input point features that are part of a dwell are returned.</bullet_item><para/>
        ///     <bullet_item>Mean centers— Points representing the mean centers of each dwell group are returned. This is the default.</bullet_item><para/>
        ///     <bullet_item>Convex hulls— Polygons representing the convex hull of each dwell group are returned.</bullet_item><para/>
        ///     <bullet_item>All features— All of the input point features are returned.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定驻留要素的输出方式。</para>
        ///   <bulletList>
        ///     <bullet_item>驻留要素 - 返回作为驻留要素一部分的所有输入点要素。</bullet_item><para/>
        ///     <bullet_item>平均中心 - 返回表示每个驻留组的平均中心的点。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>凸包 - 返回表示每个驻留组的凸包的多边形。</bullet_item><para/>
        ///     <bullet_item>所有特征 - 返回所有输入点特征。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public FindDwellLocations(object _input_features, object _output_name, List<object> _track_fields, _distance_method_value _distance_method, string? _distance_tolerance, object _time_tolerance, _output_type_value _output_type)
        {
            this._input_features = _input_features;
            this._output_name = _output_name;
            this._track_fields = _track_fields;
            this._distance_method = _distance_method;
            this._distance_tolerance = _distance_tolerance;
            this._time_tolerance = _time_tolerance;
            this._output_type = _output_type;
        }
        public override string ToolboxName => "GeoAnalytics Server Tools";

        public override string ToolName => "Find Dwell Locations";

        public override string CallName => "geoanalytics.FindDwellLocations";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "workspace"];

        public override object[] ParameterInfo => [_input_features, _output_name, _track_fields, _distance_method.GetGPValue(), _distance_tolerance, _time_tolerance, _output_type.GetGPValue(), _summary_statistics, _data_store.GetGPValue(), _output, _time_boundary_split, _time_boundary_reference];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The point tracks from which to find dwells. The input must be a time-enabled layer with features that represent instants in time.</para>
        /// <para>从中查找居住点的轨迹。输入必须是启用时间的图层，其要素可以表示时间中的瞬间。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_features { get; set; }


        /// <summary>
        /// <para>Output Dataset</para>
        /// <para>The name of the output feature service.</para>
        /// <para>输出要素服务的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_name { get; set; }


        /// <summary>
        /// <para>Track Fields</para>
        /// <para>One or more fields that will be used to identify unique tracks.</para>
        /// <para>将用于标识唯一轨迹的一个或多个字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Track Fields")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _track_fields { get; set; }


        /// <summary>
        /// <para>Distance Method</para>
        /// <para><xdoc>
        ///   <para>Specifies how the distances between dwell features will be calculated.</para>
        ///   <bulletList>
        ///     <bullet_item>Geodesic— If the spatial reference can be panned, tracks will cross the international date line when appropriate. If the spatial reference cannot be panned, tracks will be limited to the coordinate system extent and may not wrap.</bullet_item><para/>
        ///     <bullet_item>Planar—Planar distances will be used.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何计算驻留要素之间的距离。</para>
        ///   <bulletList>
        ///     <bullet_item>测地线 - 如果可以平移空间参考，则轨迹将在适当时穿过国际日期变更线。如果无法平移空间参考，则轨迹将被限制在坐标系范围内，并且可能无法换行。</bullet_item><para/>
        ///     <bullet_item>Planar—将使用平面距离。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Method")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _distance_method_value _distance_method { get; set; }

        public enum _distance_method_value
        {
            /// <summary>
            /// <para>Planar</para>
            /// <para>Planar—Planar distances will be used.</para>
            /// <para>Planar—将使用平面距离。</para>
            /// </summary>
            [Description("Planar")]
            [GPEnumValue("PLANAR")]
            _PLANAR,

            /// <summary>
            /// <para>Geodesic</para>
            /// <para>Geodesic— If the spatial reference can be panned, tracks will cross the international date line when appropriate. If the spatial reference cannot be panned, tracks will be limited to the coordinate system extent and may not wrap.</para>
            /// <para>测地线 - 如果可以平移空间参考，则轨迹将在适当时穿过国际日期变更线。如果无法平移空间参考，则轨迹将被限制在坐标系范围内，并且可能无法换行。</para>
            /// </summary>
            [Description("Geodesic")]
            [GPEnumValue("GEODESIC")]
            _GEODESIC,

        }

        /// <summary>
        /// <para>Distance Tolerance</para>
        /// <para>The maximum distance between points to be considered a single dwell location.</para>
        /// <para>要被视为单个驻留位置的点之间的最大距离。</para>
        /// <para>单位： Feet | Yards | Miles | NauticalMiles | Meters | Kilometers </para>
        /// </summary>
        [DisplayName("Distance Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _distance_tolerance { get; set; }


        /// <summary>
        /// <para>Time Tolerance</para>
        /// <para><xdoc>
        ///   <para>The minimum time duration to be considered a single dwell location.</para>
        ///   <para>Both time and distance are considered when finding dwells. The Distance Tolerance parameter specifies distance.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>被视为单个停留位置的最短持续时间。</para>
        ///   <para>在寻找驻留时，要考虑时间和距离。Distance Tolerance 参数指定距离。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _time_tolerance { get; set; }


        /// <summary>
        /// <para>Output Type</para>
        /// <para><xdoc>
        ///   <para>Specifies how the dwell features will be output.</para>
        ///   <bulletList>
        ///     <bullet_item>Dwell features— All of the input point features that are part of a dwell are returned.</bullet_item><para/>
        ///     <bullet_item>Mean centers— Points representing the mean centers of each dwell group are returned. This is the default.</bullet_item><para/>
        ///     <bullet_item>Convex hulls— Polygons representing the convex hull of each dwell group are returned.</bullet_item><para/>
        ///     <bullet_item>All features— All of the input point features are returned.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定驻留要素的输出方式。</para>
        ///   <bulletList>
        ///     <bullet_item>驻留要素 - 返回作为驻留要素一部分的所有输入点要素。</bullet_item><para/>
        ///     <bullet_item>平均中心 - 返回表示每个驻留组的平均中心的点。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>凸包 - 返回表示每个驻留组的凸包的多边形。</bullet_item><para/>
        ///     <bullet_item>所有特征 - 返回所有输入点特征。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _output_type_value _output_type { get; set; }

        public enum _output_type_value
        {
            /// <summary>
            /// <para>Mean centers</para>
            /// <para>Mean centers— Points representing the mean centers of each dwell group are returned. This is the default.</para>
            /// <para>平均中心 - 返回表示每个驻留组的平均中心的点。这是默认设置。</para>
            /// </summary>
            [Description("Mean centers")]
            [GPEnumValue("DWELL_MEAN_CENTERS")]
            _DWELL_MEAN_CENTERS,

            /// <summary>
            /// <para>Convex hulls</para>
            /// <para>Convex hulls— Polygons representing the convex hull of each dwell group are returned.</para>
            /// <para>凸包 - 返回表示每个驻留组的凸包的多边形。</para>
            /// </summary>
            [Description("Convex hulls")]
            [GPEnumValue("DWELL_CONVEX_HULLS")]
            _DWELL_CONVEX_HULLS,

            /// <summary>
            /// <para>Dwell features</para>
            /// <para>Dwell features— All of the input point features that are part of a dwell are returned.</para>
            /// <para>驻留要素 - 返回作为驻留要素一部分的所有输入点要素。</para>
            /// </summary>
            [Description("Dwell features")]
            [GPEnumValue("DWELL_FEATURES")]
            _DWELL_FEATURES,

            /// <summary>
            /// <para>All features</para>
            /// <para>All features— All of the input point features are returned.</para>
            /// <para>所有特征 - 返回所有输入点特征。</para>
            /// </summary>
            [Description("All features")]
            [GPEnumValue("ALL_FEATURES")]
            _ALL_FEATURES,

        }

        /// <summary>
        /// <para>Summary Statistics</para>
        /// <para><xdoc>
        ///   <para>The statistics that will be calculated on specified fields.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Count—The number of nonnull values. It can be used on numeric fields or strings. The count of [null, 0, 2] is 2.</bullet_item><para/>
        ///       <bullet_item>Sum—The sum of numeric values in a field. The sum of [null, null, 3] is 3.</bullet_item><para/>
        ///       <bullet_item>Mean—The mean of numeric values. The mean of [0, 2, null] is 1.</bullet_item><para/>
        ///       <bullet_item>Min—The minimum value of a numeric field. The minimum of [0, 2, null] is 0.</bullet_item><para/>
        ///       <bullet_item>Max—The maximum value of a numeric field. The maximum value of [0, 2, null] is 2.</bullet_item><para/>
        ///       <bullet_item>Standard Deviation—The standard deviation of a numeric field. The standard deviation of [1] is null. The standard deviation of [null, 1,1,1] is null.</bullet_item><para/>
        ///       <bullet_item>Variance—The variance of a numeric field in a track. The variance of [1] is null. The variance of [null, 1, 1, 1] is null.</bullet_item><para/>
        ///       <bullet_item>Range—The range of a numeric field. This is calculated as the minimum value subtracted from the maximum value. The range of [0, null, 1] is 1. The range of [null, 4] is 0.</bullet_item><para/>
        ///       <bullet_item>Any—A sample string from a field of type string.</bullet_item><para/>
        ///       <bullet_item>First—The first value of a specified field in a track. This option is available with ArcGIS Enterprise 10.8.1.</bullet_item><para/>
        ///       <bullet_item>Last—The last value of a specified field in a track. This option is available with ArcGIS Enterprise 10.8.1.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将对指定字段进行计算的统计信息。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>计数 - 非空值的数目。它可以用于数值字段或字符串。[null， 0， 2] 的计数为 2。</bullet_item><para/>
        ///       <bullet_item>总和 - 字段中数值的总和。[null， null， 3] 的总和为 3。</bullet_item><para/>
        ///       <bullet_item>均值 - 数值的平均值。[0， 2， null] 的平均值为 1。</bullet_item><para/>
        ///       <bullet_item>最小值 - 数值字段的最小值。[0， 2， null] 的最小值为 0。</bullet_item><para/>
        ///       <bullet_item>最大值 - 数值字段的最大值。[0， 2， null] 的最大值为 2。</bullet_item><para/>
        ///       <bullet_item>标准差 - 数值字段的标准差。[1] 的标准差为空。[null， 1,1,1] 的标准差为 null。</bullet_item><para/>
        ///       <bullet_item>方差 - 轨迹中数值字段的方差。[1] 的方差为 null。[null， 1， 1， 1] 的方差为 null。</bullet_item><para/>
        ///       <bullet_item>范围 - 数值字段的范围。这是通过从最大值中减去最小值来计算的。[0， null， 1] 的范围为 1。[null， 4] 的范围为 0。</bullet_item><para/>
        ///       <bullet_item>任意 - 字符串类型字段中的示例字符串。</bullet_item><para/>
        ///       <bullet_item>First - 轨迹中指定字段的第一个值。此选项适用于 ArcGIS Enterprise 10.8.1。</bullet_item><para/>
        ///       <bullet_item>最后 （Last） - 轨迹中指定字段的最后一个值。此选项适用于 ArcGIS Enterprise 10.8.1。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Summary Statistics")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _summary_statistics { get; set; } = null;


        /// <summary>
        /// <para>Data Store</para>
        /// <para><xdoc>
        ///   <para>Specifies the ArcGIS Data Store where the output will be saved. The default is Spatiotemporal big data store. All results stored in a spatiotemporal big data store will be stored in WGS84. Results stored in a relational data store will maintain their coordinate system.</para>
        ///   <bulletList>
        ///     <bullet_item>Spatiotemporal big data store—Output will be stored in a spatiotemporal big data store. This is the default.</bullet_item><para/>
        ///     <bullet_item>Relational data store—Output will be stored in a relational data store.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将保存输出的 ArcGIS Data Store。默认值为 Spatiotemporal 大数据存储。存储在时空大数据存储中的所有结果都将存储在 WGS84 中。存储在关系数据存储中的结果将保留其坐标系。</para>
        ///   <bulletList>
        ///     <bullet_item>时空大数据存储 - 输出将存储在时空大数据存储中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>关系数据存储 - 输出将存储在关系数据存储中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Data Store")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _data_store_value _data_store { get; set; } = _data_store_value._SPATIOTEMPORAL_DATA_STORE;

        public enum _data_store_value
        {
            /// <summary>
            /// <para>Spatiotemporal big data store</para>
            /// <para>Spatiotemporal big data store—Output will be stored in a spatiotemporal big data store. This is the default.</para>
            /// <para>时空大数据存储 - 输出将存储在时空大数据存储中。这是默认设置。</para>
            /// </summary>
            [Description("Spatiotemporal big data store")]
            [GPEnumValue("SPATIOTEMPORAL_DATA_STORE")]
            _SPATIOTEMPORAL_DATA_STORE,

            /// <summary>
            /// <para>Relational data store</para>
            /// <para>Relational data store—Output will be stored in a relational data store.</para>
            /// <para>关系数据存储 - 输出将存储在关系数据存储中。</para>
            /// </summary>
            [Description("Relational data store")]
            [GPEnumValue("RELATIONAL_DATA_STORE")]
            _RELATIONAL_DATA_STORE,

        }

        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output { get; set; }


        /// <summary>
        /// <para>Time Boundary Split</para>
        /// <para>A time span to split the input data into for analysis. A time boundary allows you to analyze values within a defined time span. For example, if you use a time boundary of 1 day, and set the time boundary reference to January 1, 1980, tracks will be split at the beginning of every day.</para>
        /// <para>将输入数据拆分为以进行分析的时间跨度。时间边界允许您在定义的时间跨度内分析值。例如，如果使用 1 天的时间边界，并将时间边界参考设置为 1980 年 1 月 1 日，则将在每天开始时拆分轨道。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Boundary Split")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_boundary_split { get; set; } = null;


        /// <summary>
        /// <para>Time Boundary Reference</para>
        /// <para>The reference time used to split the input data into for analysis. Time boundaries will be created for the entire span of the data, and the reference time does not need to occur at the start. If no reference time is specified, January 1, 1970, is used.</para>
        /// <para>用于将输入数据拆分为用于分析的参考时间。将为数据的整个跨度创建时间边界，并且参考时间不需要在开始时出现。如果未指定参考时间，则使用 1970 年 1 月 1 日。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Boundary Reference")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_boundary_reference { get; set; } = null;


        public FindDwellLocations SetEnv(object extent = null, object outputCoordinateSystem = null, object workspace = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, workspace: workspace);
            return this;
        }

    }

}